<script>

export default {
  name: 'ChatInput',
  data() {
    return {
      'inputData': ''
    }
  },
  methods: {
    confirmSend() {
      this.$emit('confirm_send', this.inputData) // 返回输入数据
      this.inputData = '' // 输入框清空
    }
  }
}
</script>

<template>
  <div type="flex">
    <el-input v-model="inputData" class="chat-input" :placeholder="$t('getRequirement')" @keyup.enter.native="confirmSend">
      <el-button slot="append" icon="el-icon-s-promotion" @click="confirmSend" />
    </el-input>
  </div>
</template>

<style scoped>
::v-deep .el-input__inner{
  border-bottom-left-radius: 18px;
  border-top-left-radius: 18px;
  height: 40px;
}
::v-deep .el-input-group__append{
  border-bottom-right-radius: 18px;
  border-top-right-radius: 18px;
}
.chat-input{
  left: 0;
  width: 100%;
}
</style>
